
namespace ShoppingCart.WebSite
{
    using System;
    using System.Web.Security;
    using ShoppingCart.Business.Logic;
    using ShoppingCart.WebSite.Code;

	public partial class Login : BasePage
	{
		protected void Page_Load(object sender, EventArgs e) { }

        protected void LogLoginLoggedIn(object sender, EventArgs e)
        {
            if (Roles.IsUserInRole(logLogin.UserName, "Administrador"))
            {
                Response.Redirect("Admin/Default.aspx", true);
            }
            else
            {
                var user = Membership.GetUser(logLogin.UserName);
                var cliente = ClienteManager.Instancia.ObtenerPorGuid((Guid)user.ProviderUserKey);
                if (cliente != null) IdCliente = cliente.IdCliente;
            }
        }
	}
}
